package com.common.retrofit.methods;

import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.entity.result.HomeRecommendBean;
import com.common.retrofit.entity.result.MyCollectionBean;
import com.common.retrofit.service.HaiNingService;

import java.util.ArrayList;

import rx.Observable;
import rx.Subscriber;

public class GetMyCollectionHouseMethods extends BaseMethods {

    private static GetMyCollectionHouseMethods m_ins = null;

    public static GetMyCollectionHouseMethods getInstance() {
        if (m_ins == null) {
            synchronized (GetMyCollectionHouseMethods.class) {
                if (m_ins == null) {
                    m_ins = new GetMyCollectionHouseMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "House/";
    }

    private HaiNingService initService() {
        return getRetrofit().create(HaiNingService.class);
    }

    // 获取首页数据
    public void get_collection(Subscriber<ArrayList<MyCollectionBean>> subscriber, String uid, int page) {
        Observable observable = initService().get_collection(System.currentTimeMillis()+"",
                "cfe028e7129e66a70d9ec3b7ba2d072e",uid,page
        );
        toSubscribe(observable, subscriber);
    }
}
